package org.xinjiang.data.migration.flush.enums;

import lombok.Getter;

/**
 * 学位
 */
@Getter
public enum AcademicDegreeEnum {
    UNKNOWN("5", "无", "5", null),
    BACHELOR("4", "学士", "4", null),
    MASTER("3", "硕士", "3", null),
    DR("2", "博士", "2", null),//猜测sourceCode
    HONORARY_DOCTOR("1", "名誉博士", "1", null);//猜测sourceCode

    /**
     * 数据来源code
     */
    private String sourceCode;

    /**
     * 数据来源名成
     */
    private String sourceName;


    private String targetCode;

    private Integer id;

    AcademicDegreeEnum(String sourceCode, String sourceName, String targetCode, Integer id) {
        this.sourceCode = sourceCode;
        this.sourceName = sourceName;
        this.targetCode = targetCode;
        this.id = id;
    }

    public static AcademicDegreeEnum toCode(String sourceCode) {
        for (AcademicDegreeEnum value : AcademicDegreeEnum.values()) {
            if (value.sourceCode.equals(sourceCode)) {
                return value;
            }
        }
        return UNKNOWN;
    }
}
